import request from '@/utils/request'

// 查询商品信息
export function getCmdtInfoList(query) {
    return request({
        url: '/cmdt/queryCmdtInfoByPage.action',
        method: 'get',
        params: query
    })
}

// 新增商品信息
export function insertCmdtInfo(data) {
    return request({
        url: '/cmdt/insertCmdtInfo.action',
        method: 'post',
        data: data
    })
}

// 修改商品信息
export function updateCmdtInfo(data) {
    return request({
        url: '/cmdt/updateCmdtInfo.action',
        method: 'put',
        data: data
    })
}

// 删除商品信息
export function deleteCmdtInfo(data) {
    return request({
        url: '/cmdt/deleteCmdtInfo.action',
        method: 'delete',
        data: data
    })
}

// 查询商品行情信息
export function getCmdtPriceList(query) {
    return request({
        url: '/cmdt/queryCmdtPriceByPage.action',
        method: 'get',
        params: query
    })
}

// 新增商品行情信息
export function addCmdtPrice(query) {
    return request({
        url: '/cmdt/insertCmdtPrice.action',
        method: 'post',
        data: query
    })
}

// 修改商品行情信息
export function updateCmdtPrice(query) {
    return request({
        url: '/cmdt/updateCmdtPrice.action',
        method: 'put',
        data: query
    })
}

// 查询商品行情曲线
export function queryCmdtPriceCurve(query) {
    return request({
        url: '/cmdt/queryCmdtPriceCurve.action',
        method: 'get',
        params: query
    })
}

// 删除商品行情信息
export function deleteCmdtPrice(query) {
    return request({
        url: '/cmdt/deleteCmdtPrice.action',
        method: 'delete',
        data: query
    })
}

export function getFutureInfoList(query) {
    return request({
        url: '/futures/queryCmdtFutureInfoByPage.action',
        method: 'get',
        params: query
    })
}


// 查询商品期货信息
export function getCmdtFutureList(query) {
    return request({
        url: '/cmdt/queryCmdtFutureByPage.action',
        method: 'get',
        params: query
    })
}

// 新增商品期货信息
export function addCmdtFutureInfo(query) {
    return request({
        url: '/cmdt/insertCmdtFutureInfo.action',
        method: 'post',
        data: query
    })
}

// 修改商品期货信息
export function updateCmdtFutureInfo(query) {
    return request({
        url: '/cmdt/updateCmdFuturetInfo.action',
        method: 'put',
        data: query
    })
}

// 删除商品期货信息
export function deleteCmdtFutureInfo(data) {
    return request({
        url: '/cmdt/deleteCmdtFutureInfo.action',
        method: 'delete',
        data: data
    })
}


// 查询商品期货行情信息
export function getCmdtFuturePriceList(query) {
    return request({
        url: '/cmdt/queryCmdtFuturePriceByPage.action',
        method: 'get',
        params: query
    })
}

// 查询商品延期行情信息
export function getCmdtDelPriceList(query) {
    return request({
        url: '/cmdt/queryCmdtDelPriceByPage.action',
        method: 'get',
        params: query
    })
}

// 查询商品延期信息
export function getCmdtDelInfoList(query) {
    return request({
        url: '/cmdt/queryCmdtDelByPage.action',
        method: 'get',
        params: query
    })
}

// 修改商品期货行情
export function updateCmdtFuturePrice(cmdtFutureFrom) {
    return request({
        url: '/cmdt/updateCmdtFuturePrice.action',
        method: 'post',
        data: cmdtFutureFrom
    })
}

// 修改商品延期行情
export function updateCmdtDelPrice(delayFrom) {
    return request({
        url: '/cmdt/updateCmdtDelPrice.action',
        method: 'post',
        data: delayFrom
    })
}
